﻿@using TomNet.IMSC.Model.DbModels.NewHouse;
@{
    Layout = null;
    var entity = ViewData["entity"] as Buildings;
}

<!DOCTYPE html>


<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/Css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="~/Content/Css/animate.css" rel="stylesheet">
    <link href="~/Content/Css/style.css?v=4.1.0" rel="stylesheet">
    <title>Insert</title>
    <link href="/Content/Css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Content/common.css" rel="stylesheet">
    <style>
        /*.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-12,
         .col-xs-1, .col-xs-2, .col-xs-4, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-8, .col-xs-10, .col-xs-12{
             border-style:solid; border-width:1px; border-color:#000;
        }*/
        #AwardDescriptionTitle {
            width: 132px;
        }

        #AwardDescription {
            width: 925px;
        }
    </style>
</head>
<body>
    <div class="wrapper wrapper-content animated fadeInRight">
        <form class="form-horizontal m-t" id="mainForm">


            <input type="hidden" id="Id" name="Id" value="@entity.Id" /> 


            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-xs-3 control-label">合作开始时间：</label>
                        <div class="col-xs-9">
                            <input id="CooperateBeginTime" name="CooperateBeginTime" value="@entity.CooperateBeginTime" class="form-control" placeholder="合作开始时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请选择合作开始时间</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-3 control-label">认购截止时间：</label>
                        <div class="col-xs-9">
                            <input id="SubscriptionDeadline" name="SubscriptionDeadline" value="@entity.SubscriptionDeadline" class="form-control" placeholder="认购截止时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请选择认购截止时间</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-3 control-label">开发商规则：</label>
                        <div class="col-xs-9">
                            <textarea class="form-control" id="DevelopersRules" name="DevelopersRules" rows="5">@entity.DevelopersRules</textarea>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请输入开发商规则</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-3 control-label">带看规则：</label>
                        <div class="col-xs-9"> 
                            <textarea class="form-control" id="BandSawRules" name="BandSawRules" rows="5">@entity.BandSawRules</textarea>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请填写带看规则</span>
                        </div>
                    </div>
                </div>


                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-xs-3 control-label">合作结束时间：</label>
                        <div class="col-xs-9">
                            <input id="CooperateEndTime" name="CooperateEndTime" value="@entity.CooperateEndTime" class="form-control" placeholder="合作结束时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请选择合作结束时间</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-3 control-label">合作房源：</label>
                        <div class="col-xs-9">
                            <input id="CooperativeHousing" name="CooperativeHousing" value="@entity.CooperativeHousing" type="text" class="form-control">
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请输入合作房源</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-3 control-label">报备规则：</label>
                        <div class="col-xs-9">
                            <textarea class="form-control" id="FilingRules" name="FilingRules" rows="5">@entity.FilingRules</textarea>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请输入报备规则</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-3 control-label">成交规则：</label>
                        <div class="col-xs-9"> 
                            <textarea class="form-control" id="TransactionRules" name="TransactionRules" rows="5">@entity.TransactionRules</textarea>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请填写成交规则</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-1 control-label" id="AwardDescriptionTitle">奖励说明：</label>
                        <input id="AwardDescription" name="AwardDescription" value="@entity.AwardDescription" type="text" class="form-control">
                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请输入奖励说明</span>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <button id="submit" class="btn btn-primary pull-right" type="submit">
                        <i class="fa fa-check"></i>&nbsp;提&nbsp;交
                    </button>
                </div>
            </div>
        </form>
    </div>


    <!-- 全局js -->
    <script type="text/javascript" src="~/Scripts/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="~/Scripts/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="js/content.js?v=1.0.0"></script>


    <!-- jQuery Validation plugin javascript-->
    <script type="text/javascript" src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script type="text/javascript" src="~/Scripts/Extensions/ExtValidator.js"></script>

    <!-- layer javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/layer.min.js"></script>
    <script src="/Scripts/plugins/iCheck/icheck.min.js"></script>
    <!-- layerDate plugin javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/laydate/laydate.js"></script>

    <script type="text/javascript">
        $(function () {
            var icon = "<i class='fa fa-times-circle'></i> ";
            var validator = $("#mainForm").validate({
                submitHandler: function (form) {
                    $.ajax({
                        url: "/NewHouse/Buildings/EditDeveloperRuleeditDataAsync",
                        type: "post",
                        dataType: "json",
                        data: $('#mainForm').serialize(),
                        success: function (data) {
                            //Info,Success,Warning,Error
                            var type = data.type;
                            if (type == 1) {
                                layer.msg(data.content, { icon: 6, time: 2000 },
                                    function () {
                                        var index = parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                    });

                            } else {
                                layer.msg(data.content, { icon: 5, time: 2000 });
                            }
                        }
                    });
                }
            });
        });
        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD HH:mm:ss',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD HH:mm:ss',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);

    </script>
</body>
</html>


